package com.betterjr.modules.risk.loan;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
import com.betterjr.common.web.ControllerExceptionHandler;
import com.betterjr.common.web.Servlets;
import com.betterjr.common.web.ControllerExceptionHandler.ExceptionHandler;

@Controller
@RequestMapping("/Scf/Risk/Loan/LoanCustCode")
public class LoanCustCodeController {

    private static final Logger logger = LoggerFactory.getLogger(LoanCustCodeController.class);

    @Reference(interfaceClass = ILoanCustCodeRelationService.class)
    private ILoanCustCodeRelationService custCodeRelationService;

    /**
     * 
     * @Title: queryCustList 
     * @Description: 查询供应商企业列表
     * @param request
     * @param coreNo
     * @param custCode
     * @param exculeCustNos
     * @return TODO(说明)
     * @throws 
     * @author xuyp
     * @date 2018年7月2日 上午9:54:09
     */
    @RequestMapping(value = "/queryCustList", method = RequestMethod.POST)
    public @ResponseBody String queryCustList(final HttpServletRequest request, Long coreNo, String custCode,
            String exculeCustNos) {
        Map<String, Object> anMap = Servlets.getParametersStartingWith(request, "");
        logger.info("查询供应商,入参:" + anMap.toString());
        return ControllerExceptionHandler.exec(new ExceptionHandler() {
            @Override
            public String handle() {
                return custCodeRelationService.webQueryCustList(coreNo, custCode, exculeCustNos);
            }
        }, "查询供应商失败", logger);
    }

}
